package com.bowen.spike.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.bowen.spike.my_enum.VoucherStatus;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 优惠券表
 * </p>
 *
 * @author bowen
 * @since 2025-04-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("voucher")
public class Voucher implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 优惠券状态(0 下架 1 上架 2 过期)
     */
    private VoucherStatus status;

    /**
     * 优惠金额
     */
    @NotNull
    private BigDecimal discountAmount;

    /**
     * 失效时间
     */
    @NotNull
    private LocalDateTime expirationTime;


    /**
     * 商品类型ID
     */
    @NotNull
    private Long productTypeId;

    /**
     * 库存
     */
    @NotNull
    private Integer inventory;

    /**
     * 剩余数量
     */
    private Integer quantity;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
